package com.ruoyi.personnel.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.personnel.domain.Examine;
import com.ruoyi.personnel.mapper.ExamineMapper;
import com.ruoyi.personnel.service.IExamineService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 护理考核管理Service业务层处理
 *
 * @author ruoyi
 * @date 2021-02-27
 */
@Service
public class ExamineServiceImpl extends ServiceImpl<ExamineMapper, Examine> implements IExamineService {

    @Override
    public List<Examine> queryList(Examine examine) {
        LambdaQueryWrapper<Examine> lqw = Wrappers.lambdaQuery();
        if (StringUtils.isNotBlank(examine.getName())){
            lqw.like(Examine::getName ,examine.getName());
        }
        if (StringUtils.isNotBlank(examine.getJobNumber())){
            lqw.eq(Examine::getJobNumber ,examine.getJobNumber());
        }
        if (StringUtils.isNotBlank(examine.getPersonnelId())){
            lqw.eq(Examine::getPersonnelId ,examine.getPersonnelId());
        }
        if (StringUtils.isNotBlank(examine.getExamineLevel())){
            lqw.eq(Examine::getExamineLevel ,examine.getExamineLevel());
        }
        if (StringUtils.isNotBlank(examine.getExamineType())){
            lqw.eq(Examine::getExamineType ,examine.getExamineType());
        }
        if (StringUtils.isNotBlank(examine.getExamineProject())){
            lqw.eq(Examine::getExamineProject ,examine.getExamineProject());
        }
        if (StringUtils.isNotBlank(examine.getExamineResult())){
            lqw.eq(Examine::getExamineResult ,examine.getExamineResult());
        }
        if (StringUtils.isNotBlank(examine.getExamineDate())){
            lqw.eq(Examine::getExamineDate ,examine.getExamineDate());
        }
        if (StringUtils.isNotBlank(examine.getExaminePerson())){
            lqw.eq(Examine::getExaminePerson ,examine.getExaminePerson());
        }
        if (StringUtils.isNotBlank(examine.getRemarks())){
            lqw.eq(Examine::getRemarks ,examine.getRemarks());
        }
        if (StringUtils.isNotBlank(examine.getStatus())){
            lqw.eq(Examine::getStatus ,examine.getStatus());
        }
        return this.list(lqw);
    }
}
